package com.bjpowernode.springboot.controller;

import com.bjpowernode.springboot.entity.Student;
import com.bjpowernode.springboot.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private StudentService studentService;

    @RequestMapping("selectById")
    @ResponseBody
    public Student selectStudentById(Integer id) {
        Student student = studentService.queryStudentById(id);
        return student;
    }

    @RequestMapping("/test")
    @ResponseBody
    public String connect() {
        return "connect success";
    }


}
